package niuke;

import java.math.BigInteger;
import java.util.Scanner;

public class 星际穿越 {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        BigInteger h = new BigInteger(scanner.next());
        BigInteger result = new BigInteger("1590000000");
        BigInteger k;
        BigInteger result2 = result;
        BigInteger max = new BigInteger("3180000000");
        BigInteger min = new BigInteger("1");

        while (max.subtract(min).compareTo(new BigInteger("1")) == 1){
             k = result.add(result2.multiply(result2));
             if(k.compareTo(h) == 0){
                 System.out.println(result);
                 return;
             }
             if(k.compareTo(h) == 1){
                max = result;
             }
             else if(k.compareTo(h) == -1){
                 min = result;
             }
             result = max.add(min).divide(new BigInteger("2"));
             result2 = result;
        }

        System.out.println(min);
    }
}
